<template>
  <div class="folder-card">
    <div class="folder-herder">
      <div
        v-for="(item, index) in titleArray"
        :key="`folder-header-${index}`"
        class="folder-header-trapezoid"
        @click="
          () => {
            titleKey = item.key;
          }
        "
        :class="titleKey == item.key ? 'activeColor' : ''"
      >
        {{ item.title }}
      </div>
    </div>
    <div class="folder-content"></div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      titleArray: [
        {
          title: "用户管理",
          key: "user",
        },
        {
          title: "角色管理",
          key: "juese",
        },
        {
          title: "操作日志",
          key: "info",
        },
      ],
      titleKey: "user",
    };
  },
};
</script>
<style lang="less" scoped>
.folder-card {
  background-color: #f4f5fa;
  height: 100%;
  width: 100%;
  .folder-herder {
    display: flex;
    .activeColor {
      border-bottom: 40px solid #fff !important;
      color: #1a43a9 !important;
    }
    .folder-header-trapezoid:first-child {
      border-left: 0 solid transparent;
      border-right: 20px solid transparent;
      border-bottom: 40px solid #e9ecf1;
      border-radius: 8px 16px 0 0px;
      height: 0;
      line-height: 40px;
      text-align: center;
      width: 175px;
      font-family: PingFangSC-Medium;
      font-size: 14px;
      color: #767676;
      letter-spacing: 0;
      text-align: center;
      font-weight: 500;
      cursor: pointer;
      transition: border-bottom 0.2s ease-in-out;
    }
    .folder-header-trapezoid:not(:first-child) {
      border-left: 20px solid transparent;
      border-right: 20px solid transparent;
      border-bottom: 40px solid #e9ecf1;
      border-radius: 20px 20px 0 0;
      height: 0;
      line-height: 40px;
      text-align: center;
      width: 175px;
      font-family: PingFangSC-Medium;
      font-size: 14px;
      color: #767676;
      letter-spacing: 0;
      text-align: center;
      font-weight: 500;
      cursor: pointer;
      transition: border-bottom 0.2s ease-in-out;
    }
  }
  .folder-content{
    background-color: #fff;
    height: calc(100% - 50px);
  }
}
</style>
